SDK/J Authentication Package ver1.0
RICOH Confidential

jp.co.ricoh.dsdk.scard.option.applet
Class AppletServiceImpl

java.lang.Object
  extended byjp.co.ricoh.dsdk.scard.framework.service.CardService
      extended byjp.co.ricoh.dsdk.scard.option.applet.AppletServiceImpl
All Implemented Interfaces:
AppletService

public class AppletServiceImpl
extends CardService
implements AppletService

This is a sample implementation of AppletCardService.


Field Summary
 
Fields inherited from class jp.co.ricoh.dsdk.scard.framework.service.CardService
card
 
Constructor Summary
AppletServiceImpl()
           
 
Method Summary
 void initialize(Card card)
           Initializes a card service.
 ResponseAPDU selectApplet(AppletID appletID)
           Select an applet.
 APDU sendRequestAPDU(APDU apdu)
           Sends an APDU to the currently selected card applet.
 APDU sendRequestAPDU(AppletID appletID, APDU apdu)
           Sends an APDU to the card applet which has the given AppletID.
 byte[] sendRequestAPDU(AppletID appletID, byte[] request)
           Sends a command bytes to the card applet which has the given AppletID.
 ResponseAPDU sendRequestAPDU(AppletID appletID, RequestAPDU requestAPDU)
           Sends a RequestAPDU to the card applet which has the given AppletID.
 byte[] sendRequestAPDU(byte[] request)
           Sends a command bytes to the currently selected card applet.
 ResponseAPDU sendRequestAPDU(RequestAPDU requestAPDU)
           Sends a RequestAPDU to the currently selected card applet.
 
Methods inherited from class jp.co.ricoh.dsdk.scard.framework.service.CardService
finalize, getCard
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppletServiceImpl

public AppletServiceImpl()
Method Detail

initialize

public void initialize(Card card)
                throws UnsupportedCardException,
                       CardServiceException
Description copied from class: CardService
Initializes a card service. This method is first called after the CardServiceFactory is instantiated by the Framework. If an unsupported card object is passed, UnSupportedCardException must be thrown.

Overrides:
initialize in class CardService
Parameters:
card - a card linked to this card service.
Throws:
UnsupportedCardException - when the card service does not support the card.
CardServiceException - when an error has occurred in the initialization of the card service.

selectApplet

public ResponseAPDU selectApplet(AppletID appletID)
                          throws CardServiceException
Description copied from interface: AppletService
Select an applet.

Specified by:
selectApplet in interface AppletService
Parameters:
appletID - the AppletID.
Returns:
the resulting ResponseAPDU received from the card.
Throws:
CardServiceException - if the applet selection failed.

sendRequestAPDU

public ResponseAPDU sendRequestAPDU(AppletID appletID,
                                    RequestAPDU requestAPDU)
                             throws CardServiceException,
                                    APDUException
Description copied from interface: AppletService
Sends a RequestAPDU to the card applet which has the given AppletID. The RequestAPDU will be sent after the applet selection.

Specified by:
sendRequestAPDU in interface AppletService
Parameters:
appletID - the AppletID.
requestAPDU - a RequestAPDU to be sent.
Returns:
the resulting ResponseAPDU received from the card.
Throws:
APDUException - if the response length was shorter than the status words length.
CardServiceException - if the service encountered an error.

sendRequestAPDU

public APDU sendRequestAPDU(AppletID appletID,
                            APDU apdu)
                     throws CardServiceException
Description copied from interface: AppletService
Sends an APDU to the card applet which has the given AppletID. The APDU will be sent after the applet selection.

Specified by:
sendRequestAPDU in interface AppletService
Parameters:
appletID - the AppletID.
apdu - an APDU to be sent.
Returns:
the resulting APDU received from the card.
Throws:
CardServiceException - if the service encountered an error.

sendRequestAPDU

public byte[] sendRequestAPDU(AppletID appletID,
                              byte[] request)
                       throws CardServiceException
Description copied from interface: AppletService
Sends a command bytes to the card applet which has the given AppletID. The command bytes will be sent after the applet selection.

Specified by:
sendRequestAPDU in interface AppletService
Parameters:
appletID - the AppletID.
request - a command bytes to be sent.
Returns:
the resulting command bytes received from the card.
Throws:
CardServiceException - if the service encountered an error.

sendRequestAPDU

public ResponseAPDU sendRequestAPDU(RequestAPDU requestAPDU)
                             throws CardServiceException,
                                    APDUException
Description copied from interface: AppletService
Sends a RequestAPDU to the currently selected card applet.

Specified by:
sendRequestAPDU in interface AppletService
Parameters:
requestAPDU - a RequestAPDU to be sent.
Returns:
the resulting ResponseAPDU received from the card.
Throws:
APDUException - if the response length was shorter than the status words length.
CardServiceException - if the service encountered an error.

sendRequestAPDU

public APDU sendRequestAPDU(APDU apdu)
                     throws CardServiceException
Description copied from interface: AppletService
Sends an APDU to the currently selected card applet.

Specified by:
sendRequestAPDU in interface AppletService
Parameters:
apdu - an APDU to be sent.
Returns:
the resulting APDU received from the card.
Throws:
CardServiceException - if the service encountered an error.

sendRequestAPDU

public byte[] sendRequestAPDU(byte[] request)
                       throws CardServiceException
Description copied from interface: AppletService
Sends a command bytes to the currently selected card applet.

Specified by:
sendRequestAPDU in interface AppletService
Parameters:
request - a command bytes to be sent.
Returns:
the resulting command bytes received from the card.
Throws:
CardServiceException - if the service encountered an error.

SDK/J Authentication Package ver1.0
RICOH Confidential